package com.farm.utils_qiniuyun;

import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Random;
import java.util.Scanner;
import java.util.TimeZone;
import java.util.UUID;

/*import org.junit.jupiter.api.Test;*/





///import org.apache.commons.beanutils.BeanUtils;
/**
 * 获取UUID和封装方法
 * */

public class CommonUtils {
	/**
	 * 获取UUID
	 * */
	public static String getUUID() {
		//生成随机UUID.转换成字符串.用空格替换掉-.转换成大写
		String id = UUID.randomUUID().toString().replace("-","").toUpperCase();
		return id;
	}

	
	/**
	 * 生成订单号
	 * 
	 * @return
	 */
	public static String doOrderNum() {
	    Random random = new Random();
	    SimpleDateFormat allTime = new SimpleDateFormat("YYYYMMddHHmmSSS");
	    allTime.setTimeZone(TimeZone.getTimeZone("GMT+08"));
	    String subjectno = allTime.format(new Date())+random.nextInt(10);       
	    return subjectno+random.nextInt(10);
	}
	
	public static void main(String[] args) {
		System.out.println(doOrderNum());
	}
	
}
	